package okx

import (
	"context"
	"tronServer/internal/model/domain"
	"tronServer/internal/service"

	"tronServer/api/okx/v1"
)

// OkxRateQuery 查询欧意usdt对cny汇率
func (c *ControllerV1) OkxRateQuery(ctx context.Context, req *v1.OkxRateQueryReq) (res *v1.OkxRateQueryRes, err error) {
	var (
		okxData *domain.OkxData
	)
	// 查询汇率
	{
		if okxData, err = service.Okx().Rate(ctx); err != nil {
			return
		}
	}
	res = &v1.OkxRateQueryRes{
		OkxData: okxData,
	}
	return
}
